﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel;

namespace InternshipManagement.Models
{
    [MetadataType(typeof(Semester_Validation))]
    public partial class Semester
    {
        public string DisplayName
        {
            get
            {
                return string.Concat(Year, "-", Year + 1, " ", Season);
            }
        }
        public string StatusDescription
        {
            get
            {
                return Status == "C" ? "Active" : "";
            }
        }
    }

    public class Semester_Validation
    {
        [Required(ErrorMessage = "Season is required")]
        public string Season { get; set; }
        [Required(ErrorMessage = "Year is required")]
        public int? Year { get; set; }

    }
}